package com.xhdx.ati.adau.controller.demo;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.xhdx.ati.adau.controller.service.flow.WorkFlowService;
import com.xhdx.ati.adau.entity.HolidayEntity;
import com.xhdx.ati.adau.entity.UserEntity;
import com.xhdx.ati.adau.util.BaseRespone;

@RestController
@RequestMapping("/myactivi/two")
public class SimpleTaskController {
	@Autowired
	private WorkFlowService workFlowService;

	/**
	 * 设置流程变量
	 * @param 
	 * @return
	 */
	@RequestMapping(value = "/setVariables")
    public BaseRespone<?> setVariables(String taskId, UserEntity user, HolidayEntity holidayEntity) {		
		workFlowService.setVariables(taskId, user, holidayEntity);
    	
        return BaseRespone.SUCCESS;    
    }
	/**
	 * 获取流程变量
	 * @param 
	 * @return
	 */
	@RequestMapping(value = "/getVariables")
    public BaseRespone<?> getVariables(@RequestParam(required = true) String taskId) {		
		Map<String, Object> pso = workFlowService.getVariables(taskId);
    	
        return BaseRespone.SUCCESS.content(pso);    
    }
}
